﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sto7a00
    {
		private string _trandocno;
		private string _outstk;
		private string _instk;
		private string _muser;
		private string _senduser;
		private string _recuser;
		private string _moduser;
		private string _recaddress;
        private DateTime? _mdate;
        private DateTime? _msdate;
        private DateTime? _mrdate;
        private DateTime? _sendate;
        private DateTime? _recdate;
		private string _trancom;
		private double _usept;
        private int? _status;
		private double _tranamtotal;
		private double _tranqtytotal;
		private double _sendamtotal;
		private double _sendqtytotal;
		private double _recamtotal;
		private double _recqtytotal;
		private string _remark1;
		private string _remark2;
		private string _tranid;
		private string _usercode;
		
        /// <summary>
        /// 调拨单号
        /// </summary>
		public string Trandocno
		{
			get { return _trandocno;	 }
			set { _trandocno=value;	}
		}
        /// <summary>
        /// 调出仓号
        /// </summary>
		public string Outstk
		{
			get { return _outstk;	 }
			set { _outstk=value;	}
		}
        /// <summary>
        /// 调入仓号
        /// </summary>
		public string Instk
		{
			get { return _instk;	 }
			set { _instk=value;	}
		}
        /// <summary>
        /// 制单人
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 发货人
        /// </summary>
		public string Senduser
		{
			get { return _senduser;	 }
			set { _senduser=value;	}
		}
        /// <summary>
        /// 收货人
        /// </summary>
		public string Recuser
		{
			get { return _recuser;	 }
			set { _recuser=value;	}
		}
        /// <summary>
        /// 调整人
        /// </summary>
		public string Moduser
		{
			get { return _moduser;	 }
			set { _moduser=value;	}
		}
        /// <summary>
        /// 收货地址
        /// </summary>
		public string Recaddress
		{
			get { return _recaddress;	 }
			set { _recaddress=value;	}
		}
        /// <summary>
        /// 制单日期
        /// </summary>
		public DateTime? Mdate
		{
			get { return _mdate;	 }
			set { _mdate=value;	}
		}
        /// <summary>
        /// 应发货日期
        /// </summary>
		public DateTime? Msdate
		{
			get { return _msdate;	 }
			set { _msdate=value;	}
		}
        /// <summary>
        /// 应收货日期
        /// </summary>
		public DateTime? Mrdate
		{
			get { return _mrdate;	 }
			set { _mrdate=value;	}
		}
        /// <summary>
        /// 实发日期
        /// </summary>
		public DateTime? Sendate
		{
			get { return _sendate;	 }
			set { _sendate=value;	}
		}
        /// <summary>
        /// 实收日期
        /// </summary>
		public DateTime? Recdate
		{
			get { return _recdate;	 }
			set { _recdate=value;	}
		}
        /// <summary>
        /// 物流公司
        /// </summary>
		public string Trancom
		{
			get { return _trancom;	 }
			set { _trancom=value;	}
		}
        /// <summary>
        /// 使用量
        /// </summary>
		public double Usept
		{
			get { return _usept;	 }
			set { _usept=value;	}
		}
        /// <summary>
        /// 订单状态
        /// </summary>
		public int? Status
		{
			get { return _status;	 }
			set { _status=value;	}
		}
        /// <summary>
        /// 调拨金额
        /// </summary>
		public double Tranamtotal
		{
			get { return _tranamtotal;	 }
			set { _tranamtotal=value;	}
		}
        /// <summary>
        /// 调拨数量
        /// </summary>
		public double Tranqtytotal
		{
			get { return _tranqtytotal;	 }
			set { _tranqtytotal=value;	}
		}
        /// <summary>
        /// 发货总金额
        /// </summary>
		public double Sendamtotal
		{
			get { return _sendamtotal;	 }
			set { _sendamtotal=value;	}
		}
        /// <summary>
        /// 发货总数量
        /// </summary>
		public double Sendqtytotal
		{
			get { return _sendqtytotal;	 }
			set { _sendqtytotal=value;	}
		}
        /// <summary>
        /// 收货总金额
        /// </summary>
		public double Recamtotal
		{
			get { return _recamtotal;	 }
			set { _recamtotal=value;	}
		}
        /// <summary>
        /// 收货总数量
        /// </summary>
		public double Recqtytotal
		{
			get { return _recqtytotal;	 }
			set { _recqtytotal=value;	}
		}
        /// <summary>
        /// 备注1
        /// </summary>
		public string Remark1
		{
			get { return _remark1;	 }
			set { _remark1=value;	}
		}
        /// <summary>
        /// 备注2
        /// </summary>
		public string Remark2
		{
			get { return _remark2;	 }
			set { _remark2=value;	}
		}
        /// <summary>
        /// 主键表示
        /// </summary>
		public string Tranid
		{
			get { return _tranid;	 }
			set { _tranid=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
		
		public static List<Sto7a00> GetSto7a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sto7a00> list = new List<Sto7a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sto7a00 model = GetSto7a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sto7a00 GetSto7a00ByDataRow(DataRow dr)
		{
			Sto7a00 model = new Sto7a00(); //实例化Sto7a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("trandocno")&&!(dr["trandocno"] is System.DBNull))  
				model.Trandocno = ( string)dr["trandocno"];
			if (dcc.Contains("outstk")&&!(dr["outstk"] is System.DBNull))  
				model.Outstk = ( string)dr["outstk"];
			if (dcc.Contains("instk")&&!(dr["instk"] is System.DBNull))  
				model.Instk = ( string)dr["instk"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("senduser")&&!(dr["senduser"] is System.DBNull))  
				model.Senduser = ( string)dr["senduser"];
			if (dcc.Contains("recuser")&&!(dr["recuser"] is System.DBNull))  
				model.Recuser = ( string)dr["recuser"];
			if (dcc.Contains("moduser")&&!(dr["moduser"] is System.DBNull))  
				model.Moduser = ( string)dr["moduser"];
			if (dcc.Contains("recaddress")&&!(dr["recaddress"] is System.DBNull))  
				model.Recaddress = ( string)dr["recaddress"];
			if (dcc.Contains("mdate")&&!(dr["mdate"] is System.DBNull))  
				model.Mdate = ( DateTime)dr["mdate"];
			if (dcc.Contains("msdate")&&!(dr["msdate"] is System.DBNull))  
				model.Msdate = ( DateTime)dr["msdate"];
			if (dcc.Contains("mrdate")&&!(dr["mrdate"] is System.DBNull))  
				model.Mrdate = ( DateTime)dr["mrdate"];
			if (dcc.Contains("sendate")&&!(dr["sendate"] is System.DBNull))  
				model.Sendate = ( DateTime)dr["sendate"];
			if (dcc.Contains("recdate")&&!(dr["recdate"] is System.DBNull))  
				model.Recdate = ( DateTime)dr["recdate"];
			if (dcc.Contains("trancom")&&!(dr["trancom"] is System.DBNull))  
				model.Trancom = ( string)dr["trancom"];
			if (dcc.Contains("usept")&&!(dr["usept"] is System.DBNull))  
				model.Usept = Convert.ToDouble(dr["usept"]);
			if (dcc.Contains("status")&&!(dr["status"] is System.DBNull))  
				model.Status = ( int)dr["status"];
			if (dcc.Contains("tranamtotal")&&!(dr["tranamtotal"] is System.DBNull))  
				model.Tranamtotal = Convert.ToDouble(dr["tranamtotal"]);
			if (dcc.Contains("tranqtytotal")&&!(dr["tranqtytotal"] is System.DBNull))  
				model.Tranqtytotal = Convert.ToDouble(dr["tranqtytotal"]);
			if (dcc.Contains("sendamtotal")&&!(dr["sendamtotal"] is System.DBNull))  
				model.Sendamtotal = Convert.ToDouble(dr["sendamtotal"]);
			if (dcc.Contains("sendqtytotal")&&!(dr["sendqtytotal"] is System.DBNull))  
				model.Sendqtytotal = Convert.ToDouble(dr["sendqtytotal"]);
			if (dcc.Contains("recamtotal")&&!(dr["recamtotal"] is System.DBNull))  
				model.Recamtotal = Convert.ToDouble(dr["recamtotal"]);
			if (dcc.Contains("recqtytotal")&&!(dr["recqtytotal"] is System.DBNull))  
				model.Recqtytotal = Convert.ToDouble(dr["recqtytotal"]);
			if (dcc.Contains("remark1")&&!(dr["remark1"] is System.DBNull))  
				model.Remark1 = ( string)dr["remark1"];
			if (dcc.Contains("remark2")&&!(dr["remark2"] is System.DBNull))  
				model.Remark2 = ( string)dr["remark2"];
			if (dcc.Contains("tranid")&&!(dr["tranid"] is System.DBNull))  
				model.Tranid = ( string)dr["tranid"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			
			return model;
		}
    }
}
